#include <iostream>
#include <string>
#include <bitset>

using namespace std;

// 1016. 子串能表示从 1 到 N 数字的二进制串
// https://leetcode.cn/problems/binary-string-with-substrings-representing-1-to-n/description/

class Solution {
public:
    bool queryString(string s, int n) {
        for (int i = 1; i <= n; i++){
            string binary = bitset<32>(i).to_string();
            binary.erase(0, binary.find_first_not_of('0'));
            if(s.find(binary) == string::npos){
                return false;
            }
        }
        return true;
    }
};

int main()
{
    return 0;
}